﻿#ifndef MYEXCEL_H
#define MYEXCEL_H

#include <QObject>
#include <QAxObject>

class MyExcel : public QObject
{
    Q_OBJECT
public:
    explicit MyExcel(QObject *parent = nullptr);
    QList<int> rowCnt,colCnt;

    int openFile(QString filename);
    void closeFile(int id=0);
    void saveFile(int id=0);
    bool copyFile(QString fromFile ,QString toFile, bool coverFileIfExist);
    void selectSheet(int no,int id=0);

    QString getCellValue(int r,int c,int id=0);
    void setCellValue(int r,int c,QString v,int id=0);
    void setCellValue(int r,int c,double v,int id=0);
    void deleteRow(int r,int id=0);
    void mergeCell(QString merge_cell,int id=0);
    void setTextRed(int r,int c,int id=0);
private:
    QAxObject *excel,*workbooks;
    QList<QAxObject *>workbook,worksheet;

signals:

public slots:
};

#endif // MYEXCEL_H
